package com.third.customer.site;

import com.third.customer.model.data.UserType;
import com.third.customer.model.tables.User;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created by hehuaichun on 2020/5/20.
 */
@Data
@NoArgsConstructor
public class UserInfo {

    private String token;

    private User user;

    public UserInfo(User user, String token) {
        this.user = user;
        this.token = token;
    }

    public UserType userType(){
        return UserType.codeOf(user.getType());
    }

    public Long getCompanyId(){
        return user.getCompanyId();
    }
}
